<h2>Item in catagory: <? echo $title; ?> (only top 1000)</h2>
<div align="right">
<?php 
home();
?>
</div>
<?php 
echo $p_str."&nbsp;". $n_str;
?>
<table border="0" width="90%">
<?php
//$list=cat_all_pd_list($shop_id,$cat_id,0);
$i=0;


foreach($list as $key=>$val){
//	if(!$val['id']){break;}

	$i++;

	if($i>=$start+$step) break;
	if($i<$start) continue;

	$p_id= $val['id'];

	$url="Topics/".$p_id;
	$cat_chain=preg_split("/\//",$url);
	$num=count($cat_chain);
	$cat_chain[$num-1] = preg_replace('/([0-9]*).txt/',"",$cat_chain[$num-1]);

	$related_c_id=cat_check($cat_chain,1);
	if(cat_get_all_product_num($shop_id,$related_c_id)<2){
		$related_c_id=cat_get_parent($shop_id,$related_c_id);
	}

	
	//get_pd_catalog();

	if($i>1){
	$move_up_str="<a href=\"p_cat_pd_list.php?switch=1&cat_id=$cat_id&id_1=$p_id&id_2=$pre_p_id\">(Move Up)</a>";
	}	
	$pre_p_id=$p_id;

	echo "<tr valign=\"top\">\n";
	echo "<td width=\"4\"> $i. </td>\n<td >";
	echo "<a href='${base_url}xys/$p_id'>" . $val['title']. "</a> <span class='author'>(<a href=\"p_search.php?key_au=" .$val['author']."\" >".$val['author']."</a> ".$val['date'].")</a></td>\n";
	echo "<td width=\"40\"> <a href=\"p_cat_pd_list.php?cat_id=$related_c_id\">related</a> </td>\n<td >";
//	echo "<td width=\"150\"> <a href=\"p_product_remove_confirm.php?pd_id=$p_id\">Del</a> &nbsp; <a href=\"p_product_update.php?pd_id=$p_id\">Update</a> &nbsp;  </td>\n";
//	echo "<td width=\"54\"> $move_up_str </td>\n";
	echo "</tr>\n";
}
?>
</table>

